package com.handersome.db.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.handersome.db.entity.SchoolEntity;

public interface SchoolRepository extends JpaRepository<SchoolEntity, Long>{

	@Query("select sh from SchoolEntity as sh where sh.name = ?1 and sh.address = ?2")
	public List<SchoolEntity> findByNameAndAddress(String name, String address);
	
	@Query("select sh from SchoolEntity as sh where sh.name like :name")
	public List<SchoolEntity> findByName(@Param(value = "name") String name);
}
